<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace User\Controller;
use Common\Api\UserApi;

/*
 * 用户控制器
 * 包括用户中心，用户登录及注册
 */
class FogotController extends \Common\Controller\FrontController {
/* 登录页面 */
    /* 注册页面 */
       public function fogot(){
       
            $this->display();
       
    }


 public function ajax_check() {
        $type = I('post.type', 'trim', 'email');
        $param = I('post.param','','trim');
        if(in_array($type,array('username','mobile','email'))){
            $type != 'username' && !fieldRegex($param,$type) && $this->ajaxReturn(0,L($type).'格式错误！');
            $where[$type] = $param;
            $reg = M('Members')->field('uid,status')->where($where)->find();
            if($reg['uid'] && $reg['status'] != 0){
                $this->ajaxReturn(0,L($type).'已经注册');
            }elseif(C('apply.Ucenter') && C('qscms_uc_open')){
                $passport = $this->_user_server();
                $name = 'check_'.$type;
                if(false === $passport->$name($param)){
                    $this->ajaxReturn(0,$passport->get_error());
                }
            }
            $this->ajaxReturn(1);
        }elseif($type == 'companyname'){
            if(C('qscms_company_repeat')==0){
                $reg = M('CompanyProfile')->where(array('companyname'=>$param))->getfield('id');
                $reg ? $this->ajaxReturn(0,'企业名称已经注册') : $this->ajaxReturn(1);
            }else{
                $this->ajaxReturn(1);
            }
        }
    }
    /**
     * [waiting_weixin_login 循环检测微信是否扫码登录]
     */

    
}